// This is a temporary script to run the circle seeder directly.
// Delete this file after successful execution.

'use strict';

const Sequelize = require('sequelize');
const config = require('./src/config/config.js').development; // Assuming development environment
const seeder = require('./seeders/20250605175011-circle-seeder.js'); // Make sure the seeder filename is correct

const sequelize = new Sequelize(config.database, config.username, config.password, {
    host: config.host,
    dialect: config.dialect,
    logging: console.log // Optional: enable logging to see SQL queries
});

const queryInterface = sequelize.getQueryInterface();

async function runSeeder() {
    try {
        await sequelize.authenticate();
        console.log('Database connection has been established successfully.');

        console.log('Running circle seeder...');
        await seeder.up(queryInterface, Sequelize);
        console.log('Circle seeder executed successfully.');

    } catch (error) {
        console.error('Error running seeder:', error);
    } finally {
        await sequelize.close();
        console.log('Database connection closed.');
    }
}

runSeeder();
